import request from '@/utils/request';

// 获取电子死亡记录列表
export const getRecordList = (data, params) => {
  return request({
    url: '/death/list',
    method: 'post',
    data,
    params,
  })
}

// 获取电子死亡记录详情
export const getDetailById = (data) => {
  return request({
    url: '/death/info',
    method: 'post',
    data,
  })
}

// 获取电子死亡记录详情(上报)
export const getDetailByPatientId = (params) => {
  return request({
    url: '/death/manualReport',
    method: 'get',
    params,
  })
}

// 操作按钮(@/utils/enum.js中operatorMap相关操作)
export const doEvent = (data) => {
  return request({
    url: '/death/operate',
    method: 'post',
    data,
  })
}

// 待我处理列表
export const getTodoList = (data) => {
  return request({
    url: '/death/todoList',
    method: 'post',
    data,
  })
}

// 详情页编辑保存
export const saveDetail = (data) => {
  return request({
    url: '/death/edit',
    method: 'post',
    data,
  })
}


// 获取医院信息
export const getHospital = () => {
  return request({
    url: '/hospital/info',
    method: 'get',
  })
}

// 编辑医院信息

export const editHospital = (data) => {
  return request({
    url: '/hospital/edit',
    method: 'post',
    data,
  })
}

// 获取TODOListcount
export const getTodoListCount = () => {
  return request({
    url: '/death/todolistCount',
    method: 'get',
  })
}

// 根据地址查询code和地址
export const queryCodeAndAddress = (params) => {
  return request({
    url: '/region/query',
    method: 'get',
    params,
  })
}


// 根据icd查code
export const queryCodeAndIcd = (params) => {
  return request({
    url: '/death/query/icd',
    method: 'get',
    params,
  })
}

//　获取死亡卡管理列表
export const getDeathCardList = (data, params) => {
  return request({
    url: '/death/deathCardList',
    method: 'post',
    data,
    params,
  })
}

// 死亡卡查重
export const findDeathCard = (params) => {
  return request({
    url: '/death/findDeathCard',
    method: 'get',
    params,
  })
}

// 根据姓名查病人
export const findPatientByName = (params) => {
  return request({
    url: '/user/findPatient',
    method: 'get',
    params,
  })
}

// 分级查询省、市、县/区、乡镇/街道四级
export const queryRegion = (data = {}) => {
  return request({
    url: '/region/queryCatalog',
    method: 'post',
    data,
  })
}

